﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace VietPremier.Models
{
    public class DestinationDetailModel
    {
        public int IdDestination { get; set; }
        public string DestinationName { get; set; }
        public string Price { get; set; }
        public string TripCode { get; set; }
        public string Time { get; set; }
        public string Duration { get; set; }
        public string Image { get; set; }
        public string Description { get; set; }
        public string Itinerary { get; set; }
        public string Note { get; set; }
        public string FullName { get; set; }
        public string Gender { get; set; }
        [RegularExpression(@"^[0-9]{0,15}$", ErrorMessage = "Age should contain only numbers")]
        public string Age { get; set; }
        public string Nationality { get; set; }
        public string Address { get; set; }
        [RegularExpression(@"^[0-9]{0,15}$", ErrorMessage = "Telephone Number should contain only numbers")]
        public string Telephone { get; set; }
        [EmailValidation(ErrorMessage = "Not a valid Email Address")]
        public string Email { get; set; }
        [RegularExpression(@"^[0-9]{0,15}$", ErrorMessage = "NumberofAdults should contain only numbers")]
        public string NumberofAdults { get; set; }
        [RegularExpression(@"^[0-9]{0,15}$", ErrorMessage = "NumberofChildren should contain only numbers")]
        public string NumberofChildren { get; set; }
        [RegularExpression(@"^[0-9]{0,15}$", ErrorMessage = "NumberofTraveldays should contain only numbers")]
        public string NumberofTraveldays { get; set; }
        public DateTime? DateFrom { get; set; }
        public DateTime? DateTo { get; set; }
        public string Place { get; set; }
        public string SpecialRequest { get; set; }
        public List<DestinationImage> listImage { get; set; }

    }

    public class DestinationImage
    {
        public int IdImage { get; set; }
        public string Image { get; set; }
    }

    public class EmailValidationAttribute : RegularExpressionAttribute
    {
        public EmailValidationAttribute() : base(@"^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-zA-Z0-9]{1}[a-zA-Z0-9\-]{0,62}[a-zA-Z0-9]{1})|[a-zA-Z])\.)+[a-zA-Z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$") { }
    }
}